//import createjs from 'createjs-npm';
import log from 'loglevel';
import createjs from 'createjs-npm'  // 不是直接引入createjs
//import * as createjs from 'createjs-npm';   // createjs 使用 @types/createjs

// //createjs.
// /** @type {createjs} */
// import createjs from  '../third_part/createjs/createjs'


//  eslint-disable-next-line @typescript-eslint/no-unused-vars
class Person {
    /**
     * 
     * @param {string} name 
     * @param {number} age 
     */
    constructor(name, age) {
        this.name = name;
        this.age = age;
    }

    /**
     * @returns {Person}
     */
    test1() {

    }
}

/**
 * 
 * @param {Person} person 
 */
function test_person(person) { // eslint-disable-line @typescript-eslint/no-unused-vars
    person.test1()
}

log.setLevel('debug');

// createjs.Ticker.addEventListener('tick', handleTick)

// function handleTick() {
//     log.info('Tick!')
// }

log.debug("start")
var stage = new createjs.Stage("imageView");
var bitmap = new createjs.Bitmap("assets/bos_wars/units/tank/unit_tank.png");
log.debug("set canvas equal to image size: %s,%s", bitmap.image.naturalWidth, bitmap.image.naturalHeight);
stage.canvas.width = bitmap.image.naturalWidth;
stage.canvas.height = bitmap.image.naturalHeight;
stage.addChild(bitmap);

createjs.Ticker.addEventListener('tick', on_tick);

function on_tick(event) {  // eslint-disable-line @typescript-eslint/no-unused-vars
    stage.update();
}
